<?php

use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission_;

class ClassifyPermissionsSeed extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        if (!DB::table('classify_permissions')->where('id', 1)->first()) {
            DB::table('classify_permissions')->insert(
                ['id' => 1, 'title' => '用户管理','parent_id'=>'0', 'rank' => '10', 'created_at' => date('Y-m-d H:i:s'),]
            );
        }
        if (!DB::table('classify_permissions')->where('id', 2)->first()) {
            DB::table('classify_permissions')->insert(
                ['id' => 2, 'title' => '权限','parent_id'=>'1', 'rank' => '0', 'created_at' => date('Y-m-d H:i:s'),]
            );
        }

        if (!DB::table('classify_permissions')->where('id', 3)->first()) {
            DB::table('classify_permissions')->insert(
                ['id' => 3, 'title' => '角色','parent_id'=>'1', 'rank' => '0', 'created_at' => date('Y-m-d H:i:s'),]
            );
        }
        if (!DB::table('classify_permissions')->where('id', 4)->first()) {
            DB::table('classify_permissions')->insert(
                ['id' => 4, 'title' => '管理员','parent_id'=>'1', 'rank' => '0', 'created_at' => date('Y-m-d H:i:s'),]
            );
        }

    }
}
